package com.ztom.daily.n2022.m3;

import java.util.Objects;

/**
 * 最长特殊序列
 * <p>
 * https://leetcode-cn.com/problems/longest-uncommon-subsequence-i/
 *
 * @author ZhangTao
 */
public class Day05FindLUSlength {

    public int findLUSlength(String a, String b) {
        // 只有 a b 相等, 才没有特殊序列
        if (Objects.equals(a, b)) {
            return -1;
        }

        if (a == null || a.length() == 0) {
            return b.length();
        }
        if (b == null || b.length() == 0) {
            return a.length();
        }
        return Math.max(a.length(), b.length());
    }
}
